<?php
session_start();

include_once("../../Misc.php");
include_once("../../classCol/UID.php");
include_once("../../classCol/classOracleDb.php");
include_once("../../helpers/CHtml.php");
include_once("../../helpers/Composer.php");
include_once("../../helpers/ComposerSourceDb.php");
include_once("../../models/GlobalFetchers.php");
include_once("../models/fetchers.php");

$GHtml      = new CGHtml;
$CLFetchers = new CLFetchers;
$CFetchers  = new GlobalFetchers;

$SourceDb   = new Composer;
$SourceDb   = $SourceDb->init("db");

$SourceDb->add("srcDbWarehouse",  "WHS_".$_POST["whs"]);
$SourceDb->add("srcDbMstWhs",     "MST_WAREHOUSE");
$SourceDb->add("srcDbModel",      "MST_MODEL");
$SourceDb->add("srcDbSN",         "SN_SUB_DTl");

$Db = new oracleDb;
$Db->init($_SESSION["ORCL"],
          $_SESSION["OPASS"],
          $_SESSION["SID"],
          _NO_COMMENT);

if($Db->connect()){

  $CFetchers->isModelSerNumber($Db,
                               $modelId,
                               $SourceDb->getValue("srcDbModel"),
                               $isSerNumber);

  echo  $isSerNumber;

  $Db->dc();
}else{

  echo _CONN_ERROR;
}
?>